www.gusucode.com > 网域标准通用企业自助建站系统正式版 2009 > 网域标准通用企业自助建站系统正式版 2009.18/网域公司企业网站管理系统ACCESS和SQL正式版/网域公司企业网站管理系统SQL正式版/EnPayment.asp

    <!--#include file="inc/conn.asp" -->
<%on error resume next%>
<%
'判断是否需要注册
if reg<>"1" then
	'判断是否正常购买,如果不是,需要登陆
	if session("UserName")="" then 
		response.redirect "error.asp?error=006"
		response.end
	end if
end if

username=Session("username")
set Rs = Server.CreateObject("ADODB.recordset")
sql="select * from [User] where username='"&username&"'"
rs.open sql,conn,1,1

'判断购物车是否为空
ProductList = Session("ProductList")
if productlist<>"" then
  sql="select * from Product where Product_Id in ("&productlist&") order by     Product_Id"
  Set rs = conn.Execute( sql )
else
  response.redirect "error.asp?error=007"
  response.end
end if
%> 
<html>
<head>
<title>填写订单详细信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Contact" content="网域高科(www.wygk.cn),企业网站,企业网站管理系统,网域高科公司企业网站管理系统中英繁SQL版,企业公司网站系统SQL版,企业网站管理系统,企业网站源码">
<link href="mt_style.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function CheckForm()
{
	if (document.payment.Receiver.value.length == 0) {
		alert("请输入收货人的 姓名.");
		document.payment.Receiver.focus();
		return false;
	}

	if (document.payment.Add.value.length == 0) {
		alert("请输入收货人的 地址.");
		document.payment.Add.focus();
		return false;
	}

    if (document.payment.paytype.value.length == 0) {
		alert("请选择您的支付方式.");
		document.payment.paytype.focus();
		return false;
	}

	if (document.payment.Email.value.length == 0) {
		alert("请输入此订单收货人的EMAIL.");
		document.payment.Email.focus();
		return false;
	}
	if (document.payment.Email.value.length > 0 && !document.payment.Email.value.match( /^.+@.+$/ ) ) {
	    alert("EMAIL 错误!请重新输入");
	    document.payment.Email.focus();
		return false;
	}
	
	if (document.payment.Phone.value.length == 0) {
		alert("请收货人的电话.");
		document.payment.Phone.focus();
		return false;
	}
	return true;
}

</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
 <br>
<table border="0" cellspacing="1" cellpadding="0" align="center" width="520" bgcolor="#000000">
  <tr bgcolor="#FFFFFF"> 
    <td colspan="4" height="25">&nbsp;&nbsp;<font color=B0266D><%=session("UserName")%> Your pick of the goods detail as follows: </font></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td width="50%" height="25" align="center"> Goods name </td>
    <td width="10%" align="center"> Quantity</td>
    <td width="20%" align="center"> Unit price </td> 
	<td width="20%" align="center"> Amount </td>
  </tr>
<%
   Sum = 0
   While Not rs.EOF
   Quatity = CInt( Request( "Q_" & rs("Product_Id")) )
   If Quatity <= 0 Then 
       Quatity = CInt( Session(rs("Product_Id")) )
       If Quatity <= 0 Then Quatity = 1
   End If
    Session(rs("Title")) = Quatity
    Sum = Sum + csng(rs("Price")) * Quatity
    Sum=FormatNumber(Sum,2) 
    Session("sum")=sum
%> 
  <tr bgcolor="#FFFFFF"> 
    <td width="50%" height="20">&nbsp;<font color="B0266D"><%=rs("EnTitle")%></font></td>
    <td width="10%">&nbsp;<font color="B0266D"><%=Quatity%></font></td>
    <td width="20%">&nbsp;<font color="B0266D"><%=FormatNumber(rs("Price"),2)%></font></td>
	<td width="20%">&nbsp;<font color="B0266D"><%=FormatNumber(csng(rs("Price"))*Quatity,2)%></font></td>
  </tr>
<%
rs.MoveNext
Wend
rs.close
set rs=nothing
%> 
  <tr bgcolor="#FFFFFF"> 
    <td colspan="4" height="25" align="right"> 
      <b><font color="#B0266D">Total price =<%=Sum%></font>&nbsp;&nbsp;
    </td>
  </tr>
</table>
<br>
<br>
<table border="0" cellspacing="1" cellpadding="3" align="center" width="520" bgcolor="#000000">
  <form name="payment" action="enprevieworder.asp" method="POST"  onSubmit="return CheckForm();">
<%
sql="select * from [User] where UserName='"&session("UserName")&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
Postcode=rs("Postcode")
Phone=rs("Phone")
Add=rs("Add")
Email=rs("Email")
Receiver=rs("Receiver")
CompanyName=rs("CompanyName")
Fax=rs("Fax")
rs.close
set rs=nothing
%>
    <tr bgcolor="#FFFFFF"> 
      <td width="20%">Receiver name</td>
      <td width="30%"><input type="text" name="Receiver" class="form" size="15" value=<%=Receiver%>> 
        <b><font color="#FF3333">*</font></b> </td>
      <td>Receiver tel</td>
      <td><input type="text" name="Phone" class="form" size="15" value=<%=Phone%>> 
        <b><font color="#FF3333">*</font></b> </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="27">Receiver email</td>
      <td height="27"><input type="text" name="Email"  size="16" value=<%=Email%>> 
        <b><font color="#FF3333">*</font></b></td>
      <td height="30">Method of payment</td>
      <td><select name="paytype">
          <option value="" selected>Select paytype</option>
<%
sqlp="select paytype from paydefault"
set rsp=server.createobject("ADODB.Recordset")
rsp.open sqlp,conn,1,1
while not rsp.eof
%>
<option value="<%=rsp("paytype")%>"><%=rsp("paytype")%></option>
<%
rsp.movenext
wend
rsp.close
set rsp=nothing
%>
 </select>
        <b><font color="#FF3333">*</font></b> </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="30">Postcode</td>
      <td> <input type="text" name="Postcode" size="15" value=<%=Postcode%>></td>
      <td>FAX</td>
      <td><input type="text" name="Fax" size="15" value=<%=Fax%>></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="30" >Conpany name</td>
      <td colspan=3><input type="text" name="CompanyName" size="45" value=<%=CompanyName%>></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="30" > Receiver address</td>
      <td colspan=3><input name="Add" size=45 value='<%=Add%>'> 
        <b><font color="#FF3333">*</font></b></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="30" >Message of remark</td>
      <td colspan="3"> &nbsp; <textarea name="Notes" cols="35" rows="4"></textarea> 
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="35" colspan="4" align="center"> <input type=hidden name="Sum" value="<%=Sum%>"> 
        <input type="button" name="Submit21" onClick="javascript:history.go(-1)" value="&lt;&lt; Back to modification"> 
        &nbsp;&nbsp;&nbsp; <input type="submit" name="nextstep" value="Confirm order &gt;&gt;"> 
        &nbsp;&nbsp;&nbsp; <input type="reset" name="reset" value="Fill in the message afresh"> </td>
    </tr>
  </form>
</table>
</body>
</html>
<%
set conn=nothing
%>